﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Xml.Serialization;

namespace Inbox.Domain
{
    [Table(Name = "dbo.InboxUser")]
    public class InboxUser : PersistentObject
    {
        private string _firstName;
        private string _lastName;
        private string _userName;
        private string _password;

        [Column(Name = "FirstName", Storage = "_firstName", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
        public string FirstName
        {
            get
            {
                return this._firstName;
            }
            set
            {
                this._firstName = value;
            }
        }

        [Column(Name = "LastName", Storage = "_lastName", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
        public virtual string LastName
        {
            get
            {
                return this._lastName;
            }
            set
            {
                this._lastName = value;
            }
        }

        [Column(Name = "UserName", Storage = "_userName", DbType = "NVarChar(1000)", UpdateCheck = UpdateCheck.Never)]
        public string UserName
        {
            get
            {
                return this._userName;
            }
            set
            {
                this._userName = value;
            }
        }

        [Column(Name = "Password", Storage = "_password", DbType = "NVarChar(1000)", UpdateCheck = UpdateCheck.Never)]
        public string Password
        {
            get { return this._password; }
            set { this._password = value; }
        }

        [Column(Name = "ID", Storage = "_ID", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true, UpdateCheck = UpdateCheck.Never)]
        public override Guid ID
        {
            get
            {
                return base.ID;
            }
            set
            {
                base.ID = value;
            }
        }

        [Column(Storage = "_deleted", DbType = "Bit", UpdateCheck = UpdateCheck.Never)]
        public override bool Deleted
        {
            get
            {
                return base.Deleted;
            }
            set
            {
                base.Deleted = value;
            }
        }

        [Column(Storage = "_createDate", DbType = "DateTime", UpdateCheck = UpdateCheck.Never)]
        public override DateTime CreateDate
        {
            get
            {
                return base.CreateDate;
            }
            set
            {
                base.CreateDate = value;
            }
        }

        [Column(Storage = "_createUser", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
        public override string CreateUser
        {
            get
            {
                return base.CreateUser;
            }
            set
            {
                base.CreateUser = value;
            }
        }

        [Column(Storage = "_timeStamp", AutoSync = AutoSync.Always, DbType = "rowversion", IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
        public override Binary TimeStamp
        {
            get
            {
                return base.TimeStamp;
            }
        }

        //[XmlIgnore]
        //public EntitySet<InboxRole> InboxRoles
        //{
        //    get
        //    {
        //        return this.InboxRoles;
        //    }
        //    set
        //    {
        //        this.InboxRoles.Assign(value);
        //    }
        //}

        public InboxUser()
        {
            //this.InboxRoles = new EntitySet<InboxRole>();
        }
    }
}
